//
//  WFPhotoCell.m
//  谷居
//
//  Created by dllo on 16/7/2.
//  Copyright © 2016年 刘万方. All rights reserved.
//

#import "WFPhotoCell.h"
#import "UIImageView+AFNetworking.h"
#import "WFHandleURL.h"
@implementation WFPhotoCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        _photoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height)];
        [self.contentView addSubview:_photoImageView];
        [_photoImageView release];
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    /** 避免重用之后造成视图尺寸问题, 重置视图尺寸. */
    _photoImageView.frame = self.contentView.frame;
    NSString *url = [WFHandleURL getPicURL:self.model.id];
    [_photoImageView setImageWithURL:[NSURL URLWithString:url] placeholderImage:nil];
    
    
}
@end
